#include <LosuArduino.h>

losu_vm_t vm;

void setup() {
  vm = vm_create(1024);
  losu_lib_init(vm);

  vm_setval(vm, "LED_BUILTIN", obj_newnum(vm, LED_BUILTIN));

  vm_dostring(
    vm,
    "import {*} from 'std'\n"
    "import {*} from 'arduino'\n"
    "Serial.begin(9600)\n"
    "pinMode(LED_BUILTIN, OUTPUT)\n"
    "while (true) {"
      "digitalWrite(LED_BUILTIN, HIGH)\n"
      "delay(1000)\n"
      "digitalWrite(LED_BUILTIN, LOW)\n"
      "delay(1000)\n"
    "}"
  );
}

void loop() {

}
